<?php
// +----------------------------------------------------------------------
// | 专利管理首页
// +----------------------------------------------------------------------
// | Copyright (c) 2015
// +----------------------------------------------------------------------
// | Author: baiping 125618036@qq.com http://www.webipcode.com
// +----------------------------------------------------------------------
// |2015-11-12 下午2:30:12
// +----------------------------------------------------------------------
?>
<?php $this->load->view('public/header');?>
<?php $this->load->view('public/head');?>
<div class="container-fluid">
	<div class="row">
		<?php $this->load->view('public/sideleft');?>
		<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main ">
			<!-- 内容区 -->
			<div class="main-title">
				<h3>
					<?php echo $meta_title; ?>
				</h3>
			</div>
			<div class="con">
				<div class="cf">
					<div class="pull-left">
						<a href="<?php echo site_url('patent/add')?>" class="btn btn-primary">新增</a> 
						<!-- <a href="<?php echo site_url('patent/del')?>" class="btn btn-danger ajax-post confirm" target-form="ids">删除</a>  -->
					</div>
					<div class="pull-right search-form">
					<form action="<?php echo site_url('patent/index')?>" method="post" name="search_form">
						<input class="search-input" type="text" placeholder="请输入搜索标题" name="search_name"> 
						<button type="submit" name="sub" class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
					</form>	
					</div>
				</div>
				<div class="clearfix"></div>
				<!-- 内容列表 -->
				<?php if ( $record_count > 0 ){?>
				<table class="table table-striped table-hover ">
					<thead>
						<tr>
							<th class="row-selected"><input class="checkbox check-all" type="checkbox"></th>
							<th>ID</th>
							<th>标题</th>
							<th>服务费</th>
							<th>官费</th>
							<th>添加时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<?php foreach($list as $key => $val){?>
					<tr>
						<td><input class="ids row-selected" type="checkbox" value="<?php echo $val->id; ?>" name="id[]"></td>
						<td><?php echo $val->id;?></td>
						<td>
							<small><?php echo $val->title;?></small>
							<?php if( $val->state ){?>
								<span class="badge">下架</span>
							<?php }?>
							<?php if( $val->recommend ){?>
								<span class="badge">荐</span>
							<?php }?>
						</td>
						<td>
							<span class="label label-primary">￥<?php echo $val->service_price;?>元</span>
						</td>
						<td>
							<?php 
							if ( !empty( $val->office_type ) ){
							$office_type_arr = explode( "," , $val->office_type);//官费类型
							$office_price_arr = unserialize( $val->office_price );//官费价格	
							foreach ( $office_type_arr as $val1  ){
							?>
							<!-- 获取官费类别名称 -->
							<?php echo $val->catgory[$val1];?>:
							<!-- 获取价格 -->
							￥<?php echo $office_price_arr[$val1];?>.00 元<br>
							<?php 
							}
							}else{
								echo '--';	
							}	
							?>
						</td>
						<td><?php echo time_format($val->addtime);?></td>
						<td>
							<a href="<?php echo site_url('patent/modfiy/'.$val->id);?>">修改</a>
							<?php if( $val->state ){?>
								<a href="<?php echo site_url('patent/setstate?&id='.$val->id);?>" class="confirm ajax-get">上架</a>
							<?php }else{?>
								<a href="<?php echo site_url('patent/setstate?state=1&id='.$val->id);?>" class="confirm ajax-get">下架</a>
							<?php }?>	
						</td>
					</tr>
					<?php }?>
					<tr>
						<td colspan="7">
							<ul class="pagination">
								<?php echo $pages;?>
								<li><span>共<?php echo $record_count?>条记录</span></li>
							</ul>
						</td>
					</tr>
				</table>
				<?php }else{?>
				<div class="alert alert-warning" role="alert">哦亲！暂无数据</div>
				<?php }?>	
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
//左侧菜单高亮显示
highlight_subnav( '<?php echo site_url('patent/index')?>' );
</script>
<?php $this->load->view('public/footer');?>